﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace InterfaceExample
{
    public partial class Item()
    {
        public int Id { get; set; }
        static void Add()
        {

        }
    }
    public partial class Item
    {
        public string Name {  get; set; }
        
    }
    
    class Use
    {
        Item _item  = new Item();
        public Use(Item item)
        {
            _item = item;
        }
       
        static void Main1(string[] args) 
        {
            Type type = typeof(Item);
            FieldInfo[] fieldInfo = type.GetFields(BindingFlags.Public|BindingFlags.Static|BindingFlags.Instance|BindingFlags.NonPublic);
            foreach (var field in fieldInfo) 
            {
                Console.WriteLine($"FieldName:{field.Name},FieldType:{field.FieldType.Name}");
            }

            PropertyInfo[] propertyInfo = type.GetProperties(BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Static|BindingFlags.Instance);
            foreach (var property in propertyInfo) 
            {
                Console.WriteLine($"PropertyName:{property.Name},PropertyType:{property.PropertyType.Name}");
            }

            Console.WriteLine("--------------");
            MethodInfo[] methodInfo = type.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.NonPublic|BindingFlags.Static);
            foreach(var method in methodInfo)
            {
                Console.WriteLine($"MethodName:{method.Name},MethodType:{method.ReturnType.Name}");
            }

        }

    }
}
